﻿#include "authorityservice.h"

#include <databasecenter.h>

AuthorityService::AuthorityService(QObject *parent) : QObject(parent)
{
    db = DatabaseCenter::getInstance().getConnection();
}

AuthorityService::~AuthorityService()
{
    DatabaseCenter::getInstance().releaseConnection(db);
}

bool AuthorityService::getList(QList<Authority> &list)
{
    AuthorityDao authorityDao(db);
    return authorityDao.getList(list);
}

bool AuthorityService::getOne(Authority &object)
{
    AuthorityDao authorityDao(db);
    return authorityDao.getOne(object);
}

bool AuthorityService::saveOne(Authority &object)
{
    AuthorityDao authorityDao(db);
    return authorityDao.saveOne(object);
}

bool AuthorityService::deleteOne(Authority &object)
{
    AuthorityDao authorityDao(db);
    return authorityDao.deleteOne(object);
}
